<?php

namespace App\Http\Requests\BK\Admin;

use Illuminate\Foundation\Http\FormRequest;

class AdminUpdateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'account'=>'required|alpha_num',
            'username'=>'required|alpha_num',
            'password'=>'nullable|alpha_num',
            'roles'=>'nullable|array',
        ];
    }

    public function attributes()
    {
        return [
            'account'=>'账号',
            'username'=>'用户名',
            'password'=>'密码',
            'roles'=>'角色',
        ];
    }
}
